<?php
  
  
   error_reporting (E_ALL); 
  ini_set('max_execution_time', 300);   
  
  // update (alles, ausser extract zip)
  require "../system/framework.php";  
  
  
   if ($_SERVER['HTTP_HOST'] == "localhost")
            {
            echo "not allowed";
            exit;
            }

        $http    =new http();
        $zip     =new zip();

        global $storeHost;
        $filename = "/tmp/snapol.zip";
        http::httpDownloadFile("$storeHost/store/core/snapol.zip", $filename);
        //httpDownloadFile("http://store.snapol.ch/store/core/snapol.zip", "snapol.zip");   
                              
        //$url     ="http://update.snapol.ch/snapol.zip";
        //$filename="/tmp/snapol.zip";
        //$http->httpDownloadFile($url, $filename);
        $zip->zipExtract($filename, "/");
  
  
  
  
  $install = new install();
  $install->startRemoteInstall();
  
  
  echo "<p>Update wurde erfolgreich abgeschlossen.</p>";
  echo '<p></p><a href="/">Zur Website</a></p>'; 
  
  
  
  
  
?>